<?php

namespace Kunfeng\Dify\Model\Chat;

/**
 * 标注回复模型
 */
class AnnotationReply
{
    private $answer;
    private $data;

    public function __construct(string $answer, array $data = [])
    {
        $this->answer = $answer;
        $this->data = $data;
    }

    /**
     * 从数组创建
     */
    public static function fromArray(array $data): self
    {
        return new self($data['answer'] ?? '', $data);
    }

    // Getters
    public function getAnswer(): string
    {
        return $this->answer;
    }

    public function getData(): array
    {
        return $this->data;
    }
}
